<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../vue.global.js"></script>
</head>
<body>
<div id="app"></div>
<script>
    const app = Vue.createApp({
        data() {
            return {
                inputValue: "",
                list: ['hello', 'world']
            }
        },
        methods: {},
        template: `
          <button :title="inputValue">按钮</button>
          <input v-model="inputValue">
          <todo-item v-for="(item,index) of list" :content="item" :index="index"></todo-item>
        `
    });
    // 声明了全局组件
    /*
        
    */
    app.component('todo-item', {
        props: ['content','index'],
        template: `<div>{{content}} -- {{index}}</div>`
    })
    app.mount("#app");
</script>
</body>
</html>